#pragma once

#include <algorithm/shared/data/topology/geometry/Geometry.h>
#include <algorithm/shared/utils/Vec3.h>
#include <utils/HasValue.h>
#include <utils/ParaUtils.h>

#include <boost/describe.hpp>

#include <array>

namespace solar
{
    class Rectangle3D : public Geometry
    {
        public:
            Rectangle3D() = default;
            [[nodiscard]] constexpr auto getType() const -> GeometryType override { return type_; }
#include <utils/class_name.inc>
        private:
            static constexpr const GeometryType type_ = GeometryType::kGeometryRectangle3D;
            // 矩形的长高宽
            Vec3 size_ = {kUndefined, kUndefined, kUndefined};
            // 矩形的法向
            Vec3 normal_{kUndefined, kUndefined, kUndefined};
            // 矩形的中心
            Vec3 center_{kUndefined, kUndefined, kUndefined};
            // 矩形的面积
            double area_ = kUndefined;
            // 矩形表面的顶点（由RectangleHeliostat类计算得出）
            std::array<Vec3, 4> vertices_ = {
                Vec3{kUndefined, kUndefined, kUndefined},
                {kUndefined, kUndefined, kUndefined},
                {kUndefined, kUndefined, kUndefined},
                {kUndefined, kUndefined, kUndefined}
            };
            BOOST_DESCRIBE_CLASS(Rectangle3D, (Geometry), (), (),
                                 (type_, size_, normal_, area_, center_, vertices_))
    };
} // namespace solar

#define CURRENT_CLASS_NAME Rectangle3D
#include <utils/class_describe_header.inc>
SOLAR_DESCRIBE_CLASS(Rectangle3D, (Geometry), (), (),
                     (type_, size_, normal_, area_, center_, vertices_))
